package biznussoft.metercor;

import biznussoft.metercor.service.UnCaughtException;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.view.WindowCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;

public class BaseActivity  extends ActionBarActivity
{       hjgfgjfdhgjfdhghfdh

	boolean flag;              
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		 supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR);
		ActionBar bar = getSupportActionBar();
		Drawable d=getResources().getDrawable(R.drawable.actonbarbackground);  
		bar.setBackgroundDrawable(d);
		int flags = ActionBar.DISPLAY_HOME_AS_UP;
		int change = bar.getDisplayOptions() ^ flags;
		bar.setDisplayOptions(change, flags);   
		Thread.setDefaultUncaughtExceptionHandler(new UnCaughtException(this));
	}
	
	 /*@Override
	    public boolean onCreateOptionsMenu(Menu menu) {
		 
	        menu.add("Settings");
	        MenuItem addAccount = menu.add("Account");
	        MenuItemCompat.setShowAsAction(addAccount, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
	        addAccount.setIcon(R.drawable.add); 
	        MenuItem addContact = menu.add("Contact");
	        MenuItemCompat.setShowAsAction(addContact, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
	        addContact.setIcon(R.drawable.add); 
	        MenuItem actionItem = menu.add("Logout");                 
	        MenuItemCompat.setShowAsAction(actionItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
	        actionItem.setIcon(R.drawable.logout); 
	      
	        return true;            
	    }
	 
	 @Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		 Log.i("NCS","item.getItemId()  :"+item.getItemId());
		 if(item.getItemId()== 0){
		 SalesforceSDKManager.getInstance().logout(this);}

		return super.onOptionsItemSelected(item);
	}
*/
	  @Override
	    public boolean onSupportNavigateUp() {
	        finish();
	        return true;
	    }                     


}
